#ifndef BASE_APPLICATION_H_
#define BASE_APPLICATION_H_

//#include <Windows.h>
#include <QGLWidget>

class QTimer;
class ResourceManager;

class BaseApplication : public QGLWidget
{
	Q_OBJECT

public:
	BaseApplication(QWidget *parent = 0);
	~BaseApplication();

public slots:
	virtual void Init();
	virtual void Update();

	void AppLoopProc();

	void PreUpdate();
	void PostUpdate();


protected:
	void initializeGL();
	void paintGL();
	void resizeGL(int width, int height);

	ResourceManager* mResourceManager;

	DWORD mLastTickCount;
	float mFPS;
	float mElapsedTime; // unit: s

private:
	QTimer* mTimer;
};

#endif // BASE_APPLICATION_H_